package etc.com.market;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Debug;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;

public class Util {
	
	public static void disableTouch(Activity context) {
//		Debug.MemoryInfo memoryInfo = new Debug.MemoryInfo();
//		Debug.getMemoryInfo(memoryInfo);
//
//		String memMessage = String.format(
//		    "Memory: Pss=%.2f MB, Private=%.2f MB, Shared=%.2f MB",
//		    memoryInfo.getTotalPss() / 1024.0,
//		    memoryInfo.getTotalPrivateDirty() / 1024.0,
//		    memoryInfo.getTotalSharedDirty() / 1024.0);
//
//		System.out.println("disableTouch :" + memMessage);
//		LinearLayout lo = (LinearLayout) context.findViewById(R.id.main_container);
//		if(lo != null){
//			// blablabla
//			// example to deactivate all buttons
//			ArrayList<View> touchables = lo.getTouchables();
//			for(View touchable : touchables){
//				if( touchable instanceof Button )
//					((Button)touchable).setEnabled(false);
//				else if( touchable instanceof ImageButton )
//					((ImageButton)touchable).setEnabled(false);
//			}
//		}
	}
	
	public static void enableTouch(Activity context) {
//		Debug.MemoryInfo memoryInfo = new Debug.MemoryInfo();
//		Debug.getMemoryInfo(memoryInfo);
//
//		String memMessage = String.format(
//		    "Memory: Pss=%.2f MB, Private=%.2f MB, Shared=%.2f MB",
//		    memoryInfo.getTotalPss() / 1024.0,
//		    memoryInfo.getTotalPrivateDirty() / 1024.0,
//		    memoryInfo.getTotalSharedDirty() / 1024.0);
//
//		System.out.println("enableTouch :" + memMessage);
//		
//		LinearLayout lo = (LinearLayout) context.findViewById(R.id.main_container);
//		if(lo != null){
//			// blablabla
//			// example to deactivate all buttons
//			ArrayList<View> touchables = lo.getTouchables();
//			for(View touchable : touchables){
//				if( touchable instanceof Button )
//					((Button)touchable).setEnabled(false);
//				else if( touchable instanceof ImageButton )
//					((ImageButton)touchable).setEnabled(true);
//			}
//		}
	}
}
